how to solve the diode circuits